<template>
  <div>
    <h1>{{ msg }}</h1>
    <button @click="fn">点击翻转字符串，同时大写</button>
    <button @click="fn1">点击翻转字符串，同时小写</button>
  </div>
</template>

<script>
function reverse(str) {
  return str.split('').reverse().join('')
}


export default {
  data() {
    return {
      msg: 'hello world'
    }
  },
  methods: {
    fn() {
      this.msg = reverse(this.msg).toUpperCase()
    },
    fn1() {
      this.msg = reverse(this.msg).toLowerCase()
    },
  }
}
</script>

<style>

</style>